package blog.gui;

import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Gauge;

import blog.controller.ConstGui;
import blog.SysRuntime;
import blog.controller.*;

public class SplashGui extends Form implements IBaseGui {
	
	private static final int MAX_STEP = 5;
	private Gauge gauge;
	
	public SplashGui()
	{
		super("");
		
		gauge = new Gauge("Initializing...Please wait a moment...", false, MAX_STEP, 0);
		
		this.append(gauge);
		
		SysRuntime.actionManager.addAction(this, ConstAction.ACT_SPLASH_START);
	}

	public int getIdentify() {
		return ConstGui.GUI_ID_SPLASH;
	}

	public void notifyChanged(Object param) {
		if ( param instanceof Integer )
		{
			int step = ((Integer)param).intValue();
			gauge.setValue(step);
			if ( step>=MAX_STEP )
			{
				//finish
			}
		}
	}
}